<template>
    <div class="edit-pop" :style="{left:positionInfo.left+'px',top:positionInfo.top+'px'}">
        <ul>
            <li @click="liClick(val.name)" v-for="(val,index) in list" :key="index">{{ val.name }}</li>
        </ul>
    </div>
</template>

<script setup>
import { reactive, ref, watch } from 'vue'
const props = defineProps({
  positionInfo: {
    type:Object,
    default:function() {
      return {
        left:0,
        top:0
      }
    }
  }
})
const emit = defineEmits(['itemClick']);
const list = ref([{name:'新增'},{name:'编辑'},{name:'删除'}])
function liClick(name) {
  emit('itemClick',name)
}
</script>

<style lang="scss" scoped>
.edit-pop {
  position:fixed;
  width: 200px;
  background-color:beige;
  ul {
    li {
      cursor: pointer;
    }
  }

}
</style>